
public class Score {
    public static void main(String[] args)
    {
        int[] score=new int[]{12,32,45,56,67,87,98};
        // for(int i=0;i<=score.length;i++)   该处越界，下标从0开始
        int max_num=score[0],min_num=score[0];
        for(int i=0;i<score.length;i++)
        {
            if(score[i]<min_num) min_num=score[i];
            if(score[i]>max_num) max_num=score[i];
            System.out.println(score[i]);
        }
        System.out.println("数组最大值为: "+max_num);
        System.out.println("数组最小值为: "+min_num);
    }
}
